home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 May
/
Macworld (1998-05).dmg
/
Serious Demos
/
Lasso 2.5 Test Drive
/
Lasso 2.5 CGI
/
Java
/
DBInfo
/
ImageWindow.java
< prev
Wrap
Text File
|
1997-12-12
|
630b
|
40 lines
import java.awt.*;
public class ImageWindow extends Frame
{
protected Image fImage;
public ImageWindow(Image image)
{
super("Image!");
fImage = image;
show();
MediaTracker mt = new MediaTracker(this);
mt.addImage(fImage, 1);
try
{ mt.waitForAll(); }
catch(InterruptedException e)
{ }
}
public Image getImage()
{ return fImage; }
public void paint(Graphics g)
{ g.drawImage(fImage, 0, 0, this); }
public void update(Graphics g)
{ paint(g); }
public boolean handleEvent(Event event)
{
if (event.id == Event.WINDOW_DESTROY)
{
dispose();
return true;
}
return false;
}
}